home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1995 February
/
1995-02b.d64
/
money queries
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
56 lines
95 poke53281,15:poke53280,15
100 print"[147][144]financial calculations: select one
110 [153]"1-future value
120 print"2-present value
130 [153]"3-loan payments
140 print"4-loan timing
150 [153]"5-quit
160 poke198,0:wait198,7:getx$:x=val(x$):ifx<1orx>5then100
170 ifx=5thenend
180 onxgosub290,190,390,510:goto100
190 print"present value":print"*************
200 [153]"the amount you need now to get a certain";
210 [153]"amount at a future date.":f[178]0:t[178]0:r[178]0
220 [153]"enter the following or zero to end"
230 [153]"future amount";:x[178]f:[141]620:f[178]x:[139] x[178]0 [167] [142]
240 [153]"no.periods interest compounded";:x[178]t:[141]620:t[178]x
250 [153]"% rate per period";:x[178]i:[141]620:i[178]x
260 r[178]i[173]100:z[178]f[173]((1[170]r)[174]t)
270 [153]"present value is"z:[137]220
280 [172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172]
290 [153]"future value":[153]"************
300 print"the amount you will have if you invest"
310 print"a certain amount now at a given rate":a=0:t=0:r=0
320 print"enter the following or zero to end"
330 print"investment";:x=a:gosub620:a=x:if x=0 then return
340 print"# periods interest compounded";:x=t:gosub620:t=x
350 print"% rate per period";:x=i:gosub620:i=x:r=i/100
360 x=a*(1+r)^t
370 print"the future value will be"x:goto320
380 **********************************
390 print"loan payments":print"*************
400 [153]"the time you'll need to pay off a loan
410 print"with a given payment":a=0:p=0:r=0
420 print"enter the following or zero to end"
430 print"loan amount";:x=a:gosub620:a=x:if x=0 then return
440 print"amount of each payment";:x=p:gosub620:p=x
450 print"% rate per payment";:x=i:gosub620:i=x:r=x/100
460 x=log(p/(p-a*r))/log(1+r):z=int(x)
470 print"to pay off this loan, you'll need"z:print"payments of"p"each";
480 ifint(x+.999)<>zthenprint",and one payment":print"of"p*(x-z);
490 print:goto420
500 **********************************
510 print"loan length":print"***********
520 [153]"the payments you'll need to complete a
530 print"loan by a certain time":a=0:p=0:r=0
540 print"enter the following or zero to end"
550 print"loan amount";:x=a:gosub620:a=x:if x=0 then return
560 print"# periods to pay off in";:x=p:gosub620:p=x
570 print"% rate per payment period";:x=i:gosub620:i=x:r=x/100
580 x=a*r/(1-1/(1+r)^int(p))
590 print"to pay off this loan in"int(p)"payments"
600 print"you'll need each payment to be"x:goto540
610 **********************************
620 rem input item
630 x$=str$(x):print" "x$left$("[157][157][157][157][157][157][157][157][157]",len(x$)+1);:inputx:return